<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE>
<html lang="zh-CN">
<head>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<base href="<%=basePath%>">
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<title>登录</title>
		<link rel="stylesheet" href="css/login/normalize.css">
    	<link rel="stylesheet" href="css/login/login.css">
    	<script type="text/javascript" src="js/jquery/jquery-2.1.4.min.js"></script>
</head>
<body>

	<div class="container">
		<header>
			<span class="desc"></span>
			<span class="title"></span>
		</header>
		<div class="main">
			<form action="/auth/login" method="get">
				<div>
					<span>
						<label>用户名：</label>
						<input id="username" placeholder="请输入您的用户名AAAAA">
					</span>
					<label></label>
				</div>
				<div>
					<span>
						<label>密&nbsp;&nbsp;&nbsp;码：</label>
						<input type="password" id="password" placeholder="请输入密码">
					</span>
					<label></label>
				</div>
				<div>
					<span  class="ver-span">
						<input name="code" placeholder="请输入验证码">
						<img src="http://placehold.it/130x38"> 
					</span>
					<label></label>
				</div>
				<div>
					<input class="btn" type="submit" id="do_login">
				</div>
			</form>
		</div>
		<footer>
			<div>
				<p>版权信息</p>
				<p>备案号</p>
			</div>
		</footer>		
	</div>
</body>
<script type="text/javascript">

$("#do_login").click(function(e){

		var iptjson=new Object();
		iptjson.username=$("#username").val();
		iptjson.password=$("#password").val();

	    $.get('<%=basePath%>'+'auth/login',iptjson,function(data){
             self.location="<%=basePath%>"+"stock";
	    });
	    e.preventDefault();
});

</script>
</html>